﻿using System;
using System.Drawing;

namespace MarioMapEditor
{
    class ObCloud : ObObject
    {
        public enum CLOUD {Cloud1 = 10, Cloud2};

        public ObCloud()
        {
            Width   = 3;
            Height  = 2;
        }

        public ObCloud(CLOUD nid)
        {
            Width   = 3;
            Height  = 2;
            ID      = (int)nid;
        }

        public override bool SetID(int nID)
        {
            if (checkType(nID))
            {
                ID = nID;
                return true;
            }
            return false;
        }

        public static bool checkType(int objectID)
        {
            if (Enum.IsDefined(typeof(CLOUD), objectID))
            {
                return true;
            }
            return false;
        }

        public override Bitmap GetBitmap()
        {
            if (!checkType(ID))
            {
                return null;
            }
            Bitmap src;
            switch (ID)
            {
                case (int) CLOUD.Cloud1:
                    src = Properties.Resources.Cloud1;
                    return MainForm.ResizeImage(src, new Size(Width * MainForm.TileSize, Height * MainForm.TileSize));
                case (int) CLOUD.Cloud2:
                    src = Properties.Resources.Cloud2;
                    return MainForm.ResizeImage(src, new Size(Width * MainForm.TileSize, Height * MainForm.TileSize));
            }
            return null;
        }
    }
}
